#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QApplication>
#include <QButtonGroup>
#include "adminlogin.h"
#include "storelogin.h"
#include "userlogin.h"
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}



void MainWindow::on_Enter_clicked()
{
    QRadioButton *rUser = ui->radioButton;
    QRadioButton *rStore = ui->radioButton_2;
    QRadioButton *rAdmin = ui->radioButton_3;
    if(rUser->isChecked()){
        UserLogin* pUser = new UserLogin();
        pUser->setWindowTitle(tr("Hello, User!"));
        pUser->pMainWindow = this;
        pUser->exec();
    }
    else if(rStore ->isChecked()){
        StoreLogin* pStore = new StoreLogin();
        pStore->setWindowTitle(tr("Hello, Store!"));
        pStore->pMainWindow = this;
        pStore->exec();
    }
    else if(rAdmin->isChecked()){
        AdminLogin* pAdmin = new AdminLogin();
        pAdmin->setWindowTitle(tr("Hello, Admin!"));
        pAdmin->pMainWindow = this;
        pAdmin->exec();
    }
}


void MainWindow::on_Quit_clicked()
{
    this->~MainWindow();
}

